
package com.ikamobile.flickrer;

public class Photo {
    String id;
    String title;
    private int mFarm;
    private String mSecret;
    private String mServer;

    public Photo(String id, int farm, String secret, String server, String title) {
        this.id = id;
        this.title = title;
        mFarm = farm;
        mSecret = secret;
        mServer = server;
    }

    public String getThumbnailUrl() {
        return createUrl("t");
    }

    public String getSmallSquareUrl() {
        return createUrl("s");
    }

    public String getLargeUrl() {
        return createUrl("b");
    }

    private String createUrl(String sizeSuffix) {
        int farm = mFarm;
        String secret = mSecret;
        String server = mServer;
        String url = String.format("http://farm%d.static.flickr.com/%s/%s_%s_%s.jpg", farm, server,
                id, secret, sizeSuffix);
        return url;
    }

    @Override
    public String toString() {
        return title;
    }
}
